<?php

class BaseRequest {

    /**
     * @access public
     * @var string
     */
    public $apiKey;

    /**
     * @access public
     * @var integer
     */
    public $cid;

    /**
     * @access public
     * @var string
     */
    public $customerIpAddress;

    /**
     * @access public
     * @var string
     */
    public $customerSessionId;

    /**
     * @access public
     * @var string
     */
    public $customerUserAgent;

    /**
     * @access public
     * @var tnsLocaleType
     */
    public $locale;

    /**
     * @access public
     * @var string
     */
    public $currencyCode;

    /**
     * @access public
     * @var mapEntry[]
     */
    public $additionalData;

    /**
     * @access public
     * @var string
     */
    public $sig;

    /**
     * @access public
     * @var boolean
     */
    public $debug;

    /**
     * @access public
     * @var boolean
     */
    public $test;

    /**
     * @access public
     * @var integer
     */
    public $minorRev;

    public function InheritPropertiesFrom($object) {
        if (!empty($object)) {
            if (get_class($object) === "BaseRequest" ||
                    get_class($object) === get_class($this)) {
                foreach (get_object_vars($object) as $key => $value) {
                    //echo $key.":".$value."<br />";
                    $this->$key = $value;
                }
            } else if (get_class($object) === get_class($this)) {
                return FALSE;
            }
        }
    }

}